package com.yanqu.road.entity.activity.jianchuanghua;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.utils.property.Property;

@FieldTypeAnnotation(tableName = "t_u_activity_jian_chuang_hua")
public class ChuangHuaUserData extends DataObject {

    @FieldTypeAnnotation(desc = "用户ID", select = true, update = true)
    private long userId;

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "排行用的积分")
    private int score;

    @FieldTypeAnnotation(desc = "拥有的窗花")
    private Property chuangHuaProperty; // 对应数据库chuangHuaList

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public void setScore(int score) {
        if (this.score != score) {
            this.score = score;
            setOp(DataStatus.Update);
        }
    }

    public void setChuangHuaProperty(Property chuangHuaProperty) {
        this.chuangHuaProperty = chuangHuaProperty;
        setUpdateOption();
    }

    public long getUserId() {
        return userId;
    }

    public int getActivityId() {
        return activityId;
    }

    public int getScore() {
        return score;
    }

    public Property getChuangHuaProperty() {
        return chuangHuaProperty;
    }
}
